<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: BaseMacLayer Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00026.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#pri-methods">Private Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">BaseMacLayer Class Reference<div class="ingroups"><a class="el" href="a00509.html">macLayer - MAC layer modules</a> &#124; <a class="el" href="a00516.html">baseModules - base module classes of MiXiM</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="BaseMacLayer" --><!-- doxytag: inherits="BaseLayer" -->
<p>A very simple MAC module template which provides de- and encapsulation of messages using the standard addresses. It also provides basic handling of lower layer messages.  
 <a href="a00026.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00270_source.html">BaseMacLayer.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for BaseMacLayer:</div>
<div class="dyncontent">
<div class="center"><img src="a00590.png" border="0" usemap="#BaseMacLayer_inherit__map" alt="Inheritance graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for BaseMacLayer:</div>
<div class="dyncontent">
<div class="center"><img src="a00591.png" border="0" usemap="#BaseMacLayer_coll__map" alt="Collaboration graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="a00592.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a8f1f4f485d6548964c1f1cbd75d1d9c7">BaseMacMessageKinds</a> { <a class="el" href="a00026.html#a8f1f4f485d6548964c1f1cbd75d1d9c7a0e31be8e59c319e75d7a9858ff984a2f">LAST_BASE_MAC_MESSAGE_KIND</a> =  23000
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Message kinds used by this layer.  <a href="a00026.html#a8f1f4f485d6548964c1f1cbd75d1d9c7">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a49e0e548a6c20d002bd67afa7b76c483">BaseMacControlKinds</a> { <a class="el" href="a00026.html#a49e0e548a6c20d002bd67afa7b76c483a5e5e0e55f7cc75b0d8bad06a212371f1">TX_OVER</a> =  23500, 
<a class="el" href="a00026.html#a49e0e548a6c20d002bd67afa7b76c483adebf9c77bbe6f19772866cccbef0fe4b">PACKET_DROPPED</a>, 
<a class="el" href="a00026.html#a49e0e548a6c20d002bd67afa7b76c483a914b2cf7aab4597589adb15d8fec8b18">LAST_BASE_MAC_CONTROL_KIND</a>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Control message kinds used by this layer.  <a href="a00026.html#a49e0e548a6c20d002bd67afa7b76c483">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac820b5548446a4fb7f264f1253c3d8af"></a><!-- doxytag: member="BaseMacLayer::macpkt_ptr_t" ref="ac820b5548446a4fb7f264f1253c3d8af" args="" -->
typedef MacPkt *&#160;</td><td class="memItemRight" valign="bottom"><b>macpkt_ptr_t</b></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a23cf7efcbdc6fd3f30c5e8209bb4e033"></a><!-- doxytag: member="BaseMacLayer::BaseMacLayer" ref="a23cf7efcbdc6fd3f30c5e8209bb4e033" args="(unsigned stacksize)" -->
&#160;</td><td class="memItemRight" valign="bottom"><b>BaseMacLayer</b> (unsigned stacksize)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a61c82dc3b225eac37f7fa9936c28c2c3">initialize</a> (int)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialization of the module and some variables.  <a href="#a61c82dc3b225eac37f7fa9936c28c2c3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afc72edc0b6187b41d084195028b9b61a"></a><!-- doxytag: member="BaseMacLayer::getMACAddress" ref="afc72edc0b6187b41d084195028b9b61a" args="() const " -->
const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#afc72edc0b6187b41d084195028b9b61a">getMACAddress</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the MAC address of this MAC module. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adc87295362ca7859cb6fe2a5bbe3c90d"></a><!-- doxytag: member="BaseMacLayer::registerInterface" ref="adc87295362ca7859cb6fe2a5bbe3c90d" args="()" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#adc87295362ca7859cb6fe2a5bbe3c90d">registerInterface</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers this bridge's NIC with INET's <a class="el" href="a00106.html">InterfaceTable</a>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a6de2ca07018de313a7147a03e6d77bff">handleUpperMsg</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle messages comming from the network layer.  <a href="#a6de2ca07018de313a7147a03e6d77bff"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a413375cec02b990a521b62086a02264c">handleLowerMsg</a> (cMessage *msg)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="add5277c1a60dab10db40c8d9641e48c4"></a><!-- doxytag: member="BaseMacLayer::handleSelfMsg" ref="add5277c1a60dab10db40c8d9641e48c4" args="(cMessage *)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#add5277c1a60dab10db40c8d9641e48c4">handleSelfMsg</a> (cMessage *)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle self messages such as timer... <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a796d456d593dfab3188b37e506dd76a8"></a><!-- doxytag: member="BaseMacLayer::handleLowerControl" ref="a796d456d593dfab3188b37e506dd76a8" args="(cMessage *msg)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a796d456d593dfab3188b37e506dd76a8">handleLowerControl</a> (cMessage *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle control messages from lower layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae4679596514426f66e66cb5ca9c29275"></a><!-- doxytag: member="BaseMacLayer::handleUpperControl" ref="ae4679596514426f66e66cb5ca9c29275" args="(cMessage *)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#ae4679596514426f66e66cb5ca9c29275">handleUpperControl</a> (cMessage *)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle control messages from upper layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual cPacket *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a998b4c4c56074a354b50f8c4fc5d6d4c">decapsMsg</a> (macpkt_ptr_t)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">decapsulate the network message from the MacPkt  <a href="#a998b4c4c56074a354b50f8c4fc5d6d4c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual macpkt_ptr_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a0e1c8dad62e40f43a43c7b8a0cb71501">encapsMsg</a> (cPacket *)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Encapsulate the NetwPkt into an MacPkt.  <a href="#a0e1c8dad62e40f43a43c7b8a0cb71501"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a00192.html">Signal</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a28ca155ff241c3e202a94724cc87b232">createSignal</a> (simtime_t_cref start, simtime_t_cref length, double power, double bitrate)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a simple <a class="el" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a> defined over time with the passed parameters.  <a href="#a28ca155ff241c3e202a94724cc87b232"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00136.html">Mapping</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a1c05648ce7d11bc767f9acd3d64ee067">createConstantMapping</a> (simtime_t_cref start, simtime_t_cref end, Argument::mapped_type_cref value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a simple <a class="el" href="a00136.html" title="Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.">Mapping</a> with a constant curve progression at the passed value.  <a href="#a1c05648ce7d11bc767f9acd3d64ee067"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00136.html">Mapping</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a23ed373dcfd98255df5f5ffa7e30eec6">createRectangleMapping</a> (simtime_t_cref start, simtime_t_cref end, Argument::mapped_type_cref value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a simple <a class="el" href="a00136.html" title="Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.">Mapping</a> with a constant curve progression at the passed value and discontinuities at the boundaries.  <a href="#a23ed373dcfd98255df5f5ffa7e30eec6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3da0a0f34a80528e6efcb5593a073c55"></a><!-- doxytag: member="BaseMacLayer::createSingleFrequencyMapping" ref="a3da0a0f34a80528e6efcb5593a073c55" args="(simtime_t_cref start, simtime_t_cref end, Argument::mapped_type_cref centerFreq, Argument::mapped_type_cref bandWith, Argument::mapped_type_cref value)" -->
<a class="el" href="a00058.html">ConstMapping</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a3da0a0f34a80528e6efcb5593a073c55">createSingleFrequencyMapping</a> (simtime_t_cref start, simtime_t_cref end, Argument::mapped_type_cref centerFreq, Argument::mapped_type_cref bandWith, Argument::mapped_type_cref value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a <a class="el" href="a00136.html" title="Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.">Mapping</a> defined over time and frequency with constant power in a certain frequency band. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00019.html">BaseConnectionManager</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a68f36d36168a8ba5c8a4c84c17f1ba40">getConnectionManager</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer to this MACs NICs <a class="el" href="a00052.html" title="BaseConnectionManager implementation which only defines a specific max interference distance...">ConnectionManager</a> module.  <a href="#a68f36d36168a8ba5c8a4c84c17f1ba40"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a48135ffa21044a71d92149d5301f9deb">getUpperDestinationFromControlInfo</a> (const cObject *const pCtrlInfo) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Extracts the MAC address from the "control info" structure (object).  <a href="#a48135ffa21044a71d92149d5301f9deb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual cObject *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a3f1d2f1614a5d25f8b5f64b74e1c40a7">setUpControlInfo</a> (cMessage *const pMsg, const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;pSrcAddr)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Attaches a "control info" (MacToNetw) structure (object) to the message pMsg.  <a href="#a3f1d2f1614a5d25f8b5f64b74e1c40a7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual cObject *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#ab57af129814d784f2a96978f036c575a">setDownControlInfo</a> (cMessage *const pMsg, <a class="el" href="a00192.html">Signal</a> *const pSignal)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Attaches a "control info" (MacToPhy) structure (object) to the message pMsg.  <a href="#ab57af129814d784f2a96978f036c575a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae51d8e3e0977cfc1d4f10f8135378fc4"></a><!-- doxytag: member="BaseMacLayer::getNic" ref="ae51d8e3e0977cfc1d4f10f8135378fc4" args="() const " -->
const cModule *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#ae51d8e3e0977cfc1d4f10f8135378fc4">getNic</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to nic Module. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4e979a7bc017957f4414e3210b3b12db"></a><!-- doxytag: member="BaseMacLayer::getNic" ref="a4e979a7bc017957f4414e3210b3b12db" args="()" -->
cModule *&#160;</td><td class="memItemRight" valign="bottom"><b>getNic</b> ()</td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa7b1e6bdb734765a9f4eff7d486dfbea"></a><!-- doxytag: member="BaseMacLayer::phy" ref="aa7b1e6bdb734765a9f4eff7d486dfbea" args="" -->
<a class="el" href="a00134.html">MacToPhyInterface</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#aa7b1e6bdb734765a9f4eff7d486dfbea">phy</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Handler to the physical layer. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a26ddb186455b73c8dc8b5698296804d2">headerLength</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to the arp module.  <a href="#a26ddb186455b73c8dc8b5698296804d2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8a26df9da07801d8ccb530530ef57ee2"></a><!-- doxytag: member="BaseMacLayer::myMacAddr" ref="a8a26df9da07801d8ccb530530ef57ee2" args="" -->
<a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a8a26df9da07801d8ccb530530ef57ee2">myMacAddr</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">MAC address. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab3111737703e0d4b5198478fb1f75e60"></a><!-- doxytag: member="BaseMacLayer::coreDebug" ref="ab3111737703e0d4b5198478fb1f75e60" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#ab3111737703e0d4b5198478fb1f75e60">coreDebug</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">debug this core module? <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#ab54fe535cdac4d9ee526153163991b4d">phyHeaderLength</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The length of the phy header (in bits).  <a href="#ab54fe535cdac4d9ee526153163991b4d"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2ca8cf850c20c2823cb1daf2f4a6361e"></a><!-- doxytag: member="BaseMacLayer::BaseMacLayer" ref="a2ca8cf850c20c2823cb1daf2f4a6361e" args="(const BaseMacLayer &amp;)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#a2ca8cf850c20c2823cb1daf2f4a6361e">BaseMacLayer</a> (const <a class="el" href="a00026.html">BaseMacLayer</a> &amp;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor is not allowed. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aac78343ae4c96940669323e51ec09ada"></a><!-- doxytag: member="BaseMacLayer::operator=" ref="aac78343ae4c96940669323e51ec09ada" args="(const BaseMacLayer &amp;)" -->
<a class="el" href="a00026.html">BaseMacLayer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00026.html#aac78343ae4c96940669323e51ec09ada">operator=</a> (const <a class="el" href="a00026.html">BaseMacLayer</a> &amp;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Assignment operator is not allowed. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A very simple MAC module template which provides de- and encapsulation of messages using the standard addresses. It also provides basic handling of lower layer messages. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>Daniel Willkomm, Karl Wessel </dd></dl>
</div><hr/><h2>Member Enumeration Documentation</h2>
<a class="anchor" id="a49e0e548a6c20d002bd67afa7b76c483"></a><!-- doxytag: member="BaseMacLayer::BaseMacControlKinds" ref="a49e0e548a6c20d002bd67afa7b76c483" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="a00026.html#a49e0e548a6c20d002bd67afa7b76c483">BaseMacLayer::BaseMacControlKinds</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Control message kinds used by this layer. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a49e0e548a6c20d002bd67afa7b76c483a5e5e0e55f7cc75b0d8bad06a212371f1"></a><!-- doxytag: member="TX_OVER" ref="a49e0e548a6c20d002bd67afa7b76c483a5e5e0e55f7cc75b0d8bad06a212371f1" args="" -->TX_OVER</em>&nbsp;</td><td>
<p>Indicates the end of a transmission </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a49e0e548a6c20d002bd67afa7b76c483adebf9c77bbe6f19772866cccbef0fe4b"></a><!-- doxytag: member="PACKET_DROPPED" ref="a49e0e548a6c20d002bd67afa7b76c483adebf9c77bbe6f19772866cccbef0fe4b" args="" -->PACKET_DROPPED</em>&nbsp;</td><td>
<p>Tells the netw layer that a packet to be sent has been dropped. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a49e0e548a6c20d002bd67afa7b76c483a914b2cf7aab4597589adb15d8fec8b18"></a><!-- doxytag: member="LAST_BASE_MAC_CONTROL_KIND" ref="a49e0e548a6c20d002bd67afa7b76c483a914b2cf7aab4597589adb15d8fec8b18" args="" -->LAST_BASE_MAC_CONTROL_KIND</em>&nbsp;</td><td>
<p>Stores the id on which classes extending BaseMac should continue their own control kinds. </p>
</td></tr>
</table>
</dd>
</dl>
<div class="fragment"><pre class="fragment">                             {
        <a class="code" href="a00026.html#a49e0e548a6c20d002bd67afa7b76c483a5e5e0e55f7cc75b0d8bad06a212371f1">TX_OVER</a> = 23500,
        <a class="code" href="a00026.html#a49e0e548a6c20d002bd67afa7b76c483adebf9c77bbe6f19772866cccbef0fe4b">PACKET_DROPPED</a>,
        <a class="code" href="a00026.html#a49e0e548a6c20d002bd67afa7b76c483a914b2cf7aab4597589adb15d8fec8b18">LAST_BASE_MAC_CONTROL_KIND</a>,
    };
</pre></div>
</div>
</div>
<a class="anchor" id="a8f1f4f485d6548964c1f1cbd75d1d9c7"></a><!-- doxytag: member="BaseMacLayer::BaseMacMessageKinds" ref="a8f1f4f485d6548964c1f1cbd75d1d9c7" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="a00026.html#a8f1f4f485d6548964c1f1cbd75d1d9c7">BaseMacLayer::BaseMacMessageKinds</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Message kinds used by this layer. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a8f1f4f485d6548964c1f1cbd75d1d9c7a0e31be8e59c319e75d7a9858ff984a2f"></a><!-- doxytag: member="LAST_BASE_MAC_MESSAGE_KIND" ref="a8f1f4f485d6548964c1f1cbd75d1d9c7a0e31be8e59c319e75d7a9858ff984a2f" args="" -->LAST_BASE_MAC_MESSAGE_KIND</em>&nbsp;</td><td>
<p>Stores the id on which classes extending BaseMac should continue their own message kinds. </p>
</td></tr>
</table>
</dd>
</dl>
<div class="fragment"><pre class="fragment">                             {
        <a class="code" href="a00026.html#a8f1f4f485d6548964c1f1cbd75d1d9c7a0e31be8e59c319e75d7a9858ff984a2f">LAST_BASE_MAC_MESSAGE_KIND</a> = 23000,
    };
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a1c05648ce7d11bc767f9acd3d64ee067"></a><!-- doxytag: member="BaseMacLayer::createConstantMapping" ref="a1c05648ce7d11bc767f9acd3d64ee067" args="(simtime_t_cref start, simtime_t_cref end, Argument::mapped_type_cref value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00136.html">Mapping</a> * BaseMacLayer::createConstantMapping </td>
          <td>(</td>
          <td class="paramtype">simtime_t_cref&#160;</td>
          <td class="paramname"><em>start</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">simtime_t_cref&#160;</td>
          <td class="paramname"><em>end</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Argument::mapped_type_cref&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a simple <a class="el" href="a00136.html" title="Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.">Mapping</a> with a constant curve progression at the passed value. </p>
<p>Used by "createSignal" to create the bitrate mapping. </p>

<p>References <a class="el" href="a00138.html#a0c61c76ba04339162563339b23bf42e9">MappingUtils::createMapping()</a>, <a class="el" href="a00136.html#aa713c0cd84f74727888bef5b9e8b0643ac8a952576b8d13258ba0f3c0f1584f9b">Mapping::LINEAR</a>, <a class="el" href="a00013.html#a8523627cdc70492e5e0935b9a3a78cc4">Argument::MappedZero</a>, <a class="el" href="a00136.html#ab8906dfac661d5c6a0a35cf1744f06ed">Mapping::setValue()</a>, and <a class="el" href="a00086.html#abf3b99a319deca6efc123ec52d77d867">DimensionSet::timeDomain</a>.</p>

<p>Referenced by <a class="el" href="a00026.html#a28ca155ff241c3e202a94724cc87b232">createSignal()</a>.</p>
<div class="fragment"><pre class="fragment">{
    <span class="comment">//create mapping over time</span>
    <a class="code" href="a00136.html" title="Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.">Mapping</a>* m = <a class="code" href="a00138.html#a0c61c76ba04339162563339b23bf42e9" title="Returns an appropriate changeable Mapping with the specified domain and the specified interpolation m...">MappingUtils::createMapping</a>(<a class="code" href="a00013.html#a8523627cdc70492e5e0935b9a3a78cc4" title="Zero value of a Argument value.">Argument::MappedZero</a>, <a class="code" href="a00086.html#abf3b99a319deca6efc123ec52d77d867" title="Shortcut to a DimensionSet which only contains time.">DimensionSet::timeDomain</a>, <a class="code" href="a00136.html#aa713c0cd84f74727888bef5b9e8b0643ac8a952576b8d13258ba0f3c0f1584f9b" title="interpolates linear with next lower and next upper entry constant before the first and after the last...">Mapping::LINEAR</a>);

    <span class="comment">//set position Argument</span>
    <a class="code" href="a00013.html" title="Defines an argument for a mapping.">Argument</a> startPos(start);

    <span class="comment">//set mapping at position</span>
    m-&gt;<a class="code" href="a00136.html#ab8906dfac661d5c6a0a35cf1744f06ed" title="Changes the value of the Mapping at the specified position.">setValue</a>(startPos, value);

    <span class="comment">//set position Argument</span>
    <a class="code" href="a00013.html" title="Defines an argument for a mapping.">Argument</a> endPos(end);

    <span class="comment">//set mapping at position</span>
    m-&gt;<a class="code" href="a00136.html#ab8906dfac661d5c6a0a35cf1744f06ed" title="Changes the value of the Mapping at the specified position.">setValue</a>(endPos, value);

    <span class="keywordflow">return</span> m;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a23ed373dcfd98255df5f5ffa7e30eec6"></a><!-- doxytag: member="BaseMacLayer::createRectangleMapping" ref="a23ed373dcfd98255df5f5ffa7e30eec6" args="(simtime_t_cref start, simtime_t_cref end, Argument::mapped_type_cref value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00136.html">Mapping</a> * BaseMacLayer::createRectangleMapping </td>
          <td>(</td>
          <td class="paramtype">simtime_t_cref&#160;</td>
          <td class="paramname"><em>start</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">simtime_t_cref&#160;</td>
          <td class="paramname"><em>end</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Argument::mapped_type_cref&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a simple <a class="el" href="a00136.html" title="Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.">Mapping</a> with a constant curve progression at the passed value and discontinuities at the boundaries. </p>
<p>Used by "createSignal" to create the power mapping. </p>

<p>References <a class="el" href="a00138.html#af1b74160ce464f825e0715f1fc656f5f">MappingUtils::addDiscontinuity()</a>, <a class="el" href="a00138.html#a0c61c76ba04339162563339b23bf42e9">MappingUtils::createMapping()</a>, <a class="el" href="a00136.html#aa713c0cd84f74727888bef5b9e8b0643ac8a952576b8d13258ba0f3c0f1584f9b">Mapping::LINEAR</a>, <a class="el" href="a00013.html#a8523627cdc70492e5e0935b9a3a78cc4">Argument::MappedZero</a>, <a class="el" href="a00138.html#a31183e79401391df3e2d250846ae8d0e">MappingUtils::post()</a>, <a class="el" href="a00138.html#a2cf7c04c0adea7f6e9fe49101b0197c3">MappingUtils::pre()</a>, and <a class="el" href="a00086.html#abf3b99a319deca6efc123ec52d77d867">DimensionSet::timeDomain</a>.</p>

<p>Referenced by <a class="el" href="a00026.html#a28ca155ff241c3e202a94724cc87b232">createSignal()</a>.</p>
<div class="fragment"><pre class="fragment">{
    <span class="comment">//create mapping over time</span>
    <a class="code" href="a00136.html" title="Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.">Mapping</a>* m = <a class="code" href="a00138.html#a0c61c76ba04339162563339b23bf42e9" title="Returns an appropriate changeable Mapping with the specified domain and the specified interpolation m...">MappingUtils::createMapping</a>(<a class="code" href="a00086.html#abf3b99a319deca6efc123ec52d77d867" title="Shortcut to a DimensionSet which only contains time.">DimensionSet::timeDomain</a>, <a class="code" href="a00136.html#aa713c0cd84f74727888bef5b9e8b0643ac8a952576b8d13258ba0f3c0f1584f9b" title="interpolates linear with next lower and next upper entry constant before the first and after the last...">Mapping::LINEAR</a>);

    <span class="comment">//set position Argument</span>
    <a class="code" href="a00013.html" title="Defines an argument for a mapping.">Argument</a> startPos(start);
    <span class="comment">//set discontinuity at position</span>
    <a class="code" href="a00138.html#af1b74160ce464f825e0715f1fc656f5f" title="Adds a discontinuity in time-dimension, i.e. its representation, to a passed mapping.">MappingUtils::addDiscontinuity</a>(m, startPos, <a class="code" href="a00013.html#a8523627cdc70492e5e0935b9a3a78cc4" title="Zero value of a Argument value.">Argument::MappedZero</a>, <a class="code" href="a00138.html#a31183e79401391df3e2d250846ae8d0e" title="returns the closest value of simtime after passed values">MappingUtils::post</a>(start), value);

    <span class="comment">//set position Argument</span>
    <a class="code" href="a00013.html" title="Defines an argument for a mapping.">Argument</a> endPos(end);
    <span class="comment">//set discontinuity at position</span>
    <a class="code" href="a00138.html#af1b74160ce464f825e0715f1fc656f5f" title="Adds a discontinuity in time-dimension, i.e. its representation, to a passed mapping.">MappingUtils::addDiscontinuity</a>(m, endPos, <a class="code" href="a00013.html#a8523627cdc70492e5e0935b9a3a78cc4" title="Zero value of a Argument value.">Argument::MappedZero</a>, <a class="code" href="a00138.html#a2cf7c04c0adea7f6e9fe49101b0197c3" title="returns the closest value of simtime before passed value">MappingUtils::pre</a>(end), value);

    <span class="keywordflow">return</span> m;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a28ca155ff241c3e202a94724cc87b232"></a><!-- doxytag: member="BaseMacLayer::createSignal" ref="a28ca155ff241c3e202a94724cc87b232" args="(simtime_t_cref start, simtime_t_cref length, double power, double bitrate)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00192.html">Signal</a> * BaseMacLayer::createSignal </td>
          <td>(</td>
          <td class="paramtype">simtime_t_cref&#160;</td>
          <td class="paramname"><em>start</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">simtime_t_cref&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>power</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>bitrate</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates a simple <a class="el" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a> defined over time with the passed parameters. </p>
<p>Convenience method to be able to create the appropriate <a class="el" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a> for the <a class="el" href="a00133.html" title="Stores information which is needed by the physical layer when sending a MacPkt.">MacToPhyControlInfo</a> without needing to care about creating Mappings.</p>
<p>NOTE: The created signal's transmission-power is a rectangular function. This method uses <a class="el" href="a00138.html#af1b74160ce464f825e0715f1fc656f5f" title="Adds a discontinuity in time-dimension, i.e. its representation, to a passed mapping.">MappingUtils::addDiscontinuity</a> to represent the discontinuities at the beginning and end of this rectangular function. Because of this the created mapping which represents the signal's transmission-power is still zero at the exact start and end. Please see the method <a class="el" href="a00138.html#af1b74160ce464f825e0715f1fc656f5f" title="Adds a discontinuity in time-dimension, i.e. its representation, to a passed mapping.">MappingUtils::addDiscontinuity</a> for the reason. </p>

<p>Reimplemented in <a class="el" href="a00128.html#a3a62f334346a15619853a8c6c87367aa">Mac80211</a>.</p>

<p>References <a class="el" href="a00026.html#a1c05648ce7d11bc767f9acd3d64ee067">createConstantMapping()</a>, <a class="el" href="a00026.html#a23ed373dcfd98255df5f5ffa7e30eec6">createRectangleMapping()</a>, <a class="el" href="a00192.html#a86e4ecdabd5ca03ede5e2c81c6b76002">Signal::setBitrate()</a>, and <a class="el" href="a00192.html#ad8c5494d0f7bd564bf14dc0c90f9a361">Signal::setTransmissionPower()</a>.</p>

<p>Referenced by <a class="el" href="a00126.html#a14db63191f60dc3f3b906ce02eec6628">LMacLayer::attachSignal()</a>, <a class="el" href="a00035.html#a5f0384e6e1a28a7d303ec5d6d2cc9dd4">BMacLayer::attachSignal()</a>, and <a class="el" href="a00069.html#a89de5fd0b7f0d1420c1d4e9118c00ef3">CSMAMacLayer::encapsMsg()</a>.</p>
<div class="fragment"><pre class="fragment">{
    simtime_t end = start + length;
    <span class="comment">//create signal with start at current simtime and passed length</span>
    <a class="code" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a>* s = <span class="keyword">new</span> <a class="code" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a>(start, length);

    <span class="comment">//create and set tx power mapping</span>
    <a class="code" href="a00136.html" title="Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.">Mapping</a>* txPowerMapping = <a class="code" href="a00026.html#a23ed373dcfd98255df5f5ffa7e30eec6" title="Creates a simple Mapping with a constant curve progression at the passed value and discontinuities at...">createRectangleMapping</a>(start, end, power);
    s-&gt;<a class="code" href="a00192.html#ad8c5494d0f7bd564bf14dc0c90f9a361" title="Sets the function representing the transmission power of the signal.">setTransmissionPower</a>(txPowerMapping);

    <span class="comment">//create and set bitrate mapping</span>
    <a class="code" href="a00136.html" title="Represents a changeable mapping (mathematical function) from at least time to Argument::mapped_type.">Mapping</a>* bitrateMapping = <a class="code" href="a00026.html#a1c05648ce7d11bc767f9acd3d64ee067" title="Creates a simple Mapping with a constant curve progression at the passed value.">createConstantMapping</a>(start, end, bitrate);
    s-&gt;<a class="code" href="a00192.html#a86e4ecdabd5ca03ede5e2c81c6b76002" title="Sets the function representing the bitrate of the signal.">setBitrate</a>(bitrateMapping);

    <span class="keywordflow">return</span> s;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a998b4c4c56074a354b50f8c4fc5d6d4c"></a><!-- doxytag: member="BaseMacLayer::decapsMsg" ref="a998b4c4c56074a354b50f8c4fc5d6d4c" args="(macpkt_ptr_t)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cPacket * BaseMacLayer::decapsMsg </td>
          <td>(</td>
          <td class="paramtype">macpkt_ptr_t&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>decapsulate the network message from the MacPkt </p>
<p>Decapsulates the network packet from the received MacPkt </p>

<p>Reimplemented in <a class="el" href="a00067.html#aedcaefc83f850c1ca35836cb223b412e">csma</a>, <a class="el" href="a00128.html#a9c6a33b29ff6e1500947fd6ca221b13e">Mac80211</a>, and <a class="el" href="a00068.html#ab2174202ba00f0731fc9924597aba925">CSMA802154</a>.</p>

<p>References <a class="el" href="a00026.html#a3f1d2f1614a5d25f8b5f64b74e1c40a7">setUpControlInfo()</a>.</p>

<p>Referenced by <a class="el" href="a00026.html#a413375cec02b990a521b62086a02264c">handleLowerMsg()</a>, <a class="el" href="a00069.html#a83911b5673de047bcfc3c9b0a719ff15">CSMAMacLayer::handleLowerMsg()</a>, <a class="el" href="a00035.html#a0d6b089a3e75932385bf38815b44b8bc">BMacLayer::handleSelfMsg()</a>, and <a class="el" href="a00126.html#a2397193676d296cc6757b31eef203bb3">LMacLayer::handleSelfMsg()</a>.</p>
<div class="fragment"><pre class="fragment">{
    cPacket *m = msg-&gt;decapsulate();
    <a class="code" href="a00026.html#a3f1d2f1614a5d25f8b5f64b74e1c40a7" title="Attaches a &quot;control info&quot; (MacToNetw) structure (object) to the message pMsg.">setUpControlInfo</a>(m, msg-&gt;getSrcAddr());
    <span class="comment">// delete the macPkt</span>
    <span class="keyword">delete</span> msg;
    coreEV &lt;&lt; <span class="stringliteral">&quot; message decapsulated &quot;</span> &lt;&lt; endl;
    <span class="keywordflow">return</span> m;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a0e1c8dad62e40f43a43c7b8a0cb71501"></a><!-- doxytag: member="BaseMacLayer::encapsMsg" ref="a0e1c8dad62e40f43a43c7b8a0cb71501" args="(cPacket *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BaseMacLayer::macpkt_ptr_t BaseMacLayer::encapsMsg </td>
          <td>(</td>
          <td class="paramtype">cPacket *&#160;</td>
          <td class="paramname"><em>netwPkt</em></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Encapsulate the NetwPkt into an MacPkt. </p>
<p>Encapsulates the received NetwPkt into a MacPkt and set all needed header fields. </p>

<p>Reimplemented in <a class="el" href="a00069.html#a89de5fd0b7f0d1420c1d4e9118c00ef3">CSMAMacLayer</a>, <a class="el" href="a00128.html#a23738e3ef2aa14da9dbdcb3d0abbf4e2">Mac80211</a>, <a class="el" href="a00126.html#a85b92d5d2292228cb408f4e72fca7caf">LMacLayer</a>, and <a class="el" href="a00008.html#a52988f430b2def656fdb4b1f6dc15395">AlohaMacLayer</a>.</p>

<p>References <a class="el" href="a00026.html#a48135ffa21044a71d92149d5301f9deb">getUpperDestinationFromControlInfo()</a>, <a class="el" href="a00026.html#a26ddb186455b73c8dc8b5698296804d2">headerLength</a>, and <a class="el" href="a00026.html#a8a26df9da07801d8ccb530530ef57ee2">myMacAddr</a>.</p>

<p>Referenced by <a class="el" href="a00026.html#a6de2ca07018de313a7147a03e6d77bff">handleUpperMsg()</a>.</p>
<div class="fragment"><pre class="fragment">{
    macpkt_ptr_t pkt = <span class="keyword">new</span> MacPkt(netwPkt-&gt;getName(), netwPkt-&gt;getKind());
    pkt-&gt;setBitLength(<a class="code" href="a00026.html#a26ddb186455b73c8dc8b5698296804d2" title="Pointer to the arp module.">headerLength</a>);

    <span class="comment">// copy dest address from the Control Info attached to the network</span>
    <span class="comment">// message by the network layer</span>
    cObject* cInfo = netwPkt-&gt;removeControlInfo();

    coreEV &lt;&lt; <span class="stringliteral">&quot;CInfo removed, mac addr=&quot;</span> &lt;&lt; <a class="code" href="a00026.html#a48135ffa21044a71d92149d5301f9deb" title="Extracts the MAC address from the &quot;control info&quot; structure (object).">getUpperDestinationFromControlInfo</a>(cInfo) &lt;&lt; endl;
    pkt-&gt;setDestAddr(<a class="code" href="a00026.html#a48135ffa21044a71d92149d5301f9deb" title="Extracts the MAC address from the &quot;control info&quot; structure (object).">getUpperDestinationFromControlInfo</a>(cInfo));

    <span class="comment">//delete the control info</span>
    <span class="keyword">delete</span> cInfo;

    <span class="comment">//set the src address to own mac address (nic module getId())</span>
    pkt-&gt;setSrcAddr(<a class="code" href="a00026.html#a8a26df9da07801d8ccb530530ef57ee2" title="MAC address.">myMacAddr</a>);

    <span class="comment">//encapsulate the network packet</span>
    pkt-&gt;encapsulate(netwPkt);
    coreEV &lt;&lt; <span class="stringliteral">&quot;pkt encapsulated\n&quot;</span>;

    <span class="keywordflow">return</span> pkt;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a68f36d36168a8ba5c8a4c84c17f1ba40"></a><!-- doxytag: member="BaseMacLayer::getConnectionManager" ref="a68f36d36168a8ba5c8a4c84c17f1ba40" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00019.html">BaseConnectionManager</a> * BaseMacLayer::getConnectionManager </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns a pointer to this MACs NICs <a class="el" href="a00052.html" title="BaseConnectionManager implementation which only defines a specific max interference distance...">ConnectionManager</a> module. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>pointer to the connection manager module </dd></dl>

<p>References <a class="el" href="a00026.html#ae51d8e3e0977cfc1d4f10f8135378fc4">getNic()</a>.</p>

<p>Referenced by <a class="el" href="a00128.html#ab81dae24d79c2ef010301e2c219966c1">Mac80211::initialize()</a>, and <a class="el" href="a00067.html#a24e7a48bd1d9036139c75b558ade4161">csma::initialize()</a>.</p>
<div class="fragment"><pre class="fragment">{
    <span class="keywordflow">return</span> <a class="code" href="a00026.html#a68f36d36168a8ba5c8a4c84c17f1ba40" title="Returns a pointer to this MACs NICs ConnectionManager module.">ConnectionManagerAccess::getConnectionManager</a>(<a class="code" href="a00026.html#ae51d8e3e0977cfc1d4f10f8135378fc4" title="Pointer to nic Module.">getNic</a>());
}
</pre></div>
</div>
</div>
<a class="anchor" id="a48135ffa21044a71d92149d5301f9deb"></a><!-- doxytag: member="BaseMacLayer::getUpperDestinationFromControlInfo" ref="a48135ffa21044a71d92149d5301f9deb" args="(const cObject *const pCtrlInfo) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp; BaseMacLayer::getUpperDestinationFromControlInfo </td>
          <td>(</td>
          <td class="paramtype">const cObject *const&#160;</td>
          <td class="paramname"><em>pCtrlInfo</em></td><td>)</td>
          <td> const<code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Extracts the MAC address from the "control info" structure (object). </p>
<p>Extract the destination MAC address from the "control info" which was prev. set by <a class="el" href="a00157.html#a9556c1d066423e39247217d7a7f2a456" title="Attaches a &quot;control info&quot; structure (object) to the message pMsg.">NetwToMacControlInfo::setControlInfo()</a>.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pCtrlInfo</td><td>The "control info" structure (object) prev. set by <a class="el" href="a00157.html#a9556c1d066423e39247217d7a7f2a456" title="Attaches a &quot;control info&quot; structure (object) to the message pMsg.">NetwToMacControlInfo::setControlInfo()</a>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The MAC address of message receiver. </dd></dl>

<p>References <a class="el" href="a00157.html#add42e098a1af72c3fbc8be746d04b27f">NetwToMacControlInfo::getDestFromControlInfo()</a>.</p>

<p>Referenced by <a class="el" href="a00035.html#acff92f0d4ba44ee5035c0d3729729257">BMacLayer::addToQueue()</a>, <a class="el" href="a00126.html#a85b92d5d2292228cb408f4e72fca7caf">LMacLayer::encapsMsg()</a>, <a class="el" href="a00026.html#a0e1c8dad62e40f43a43c7b8a0cb71501">encapsMsg()</a>, <a class="el" href="a00128.html#a23738e3ef2aa14da9dbdcb3d0abbf4e2">Mac80211::encapsMsg()</a>, and <a class="el" href="a00067.html#ad85c18d90e41eb2074593a44b64ab855">csma::handleUpperMsg()</a>.</p>
<div class="fragment"><pre class="fragment">{
    <span class="keywordflow">return</span> <a class="code" href="a00157.html#add42e098a1af72c3fbc8be746d04b27f" title="Extracts the MAC address from the &quot;control info&quot; structure (object).">NetwToMacControlInfo::getDestFromControlInfo</a>(pCtrlInfo);
}
</pre></div>
</div>
</div>
<a class="anchor" id="a413375cec02b990a521b62086a02264c"></a><!-- doxytag: member="BaseMacLayer::handleLowerMsg" ref="a413375cec02b990a521b62086a02264c" args="(cMessage *msg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BaseMacLayer::handleLowerMsg </td>
          <td>(</td>
          <td class="paramtype">cMessage *&#160;</td>
          <td class="paramname"><em>msg</em></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>If message arrives from lower layer, check whether it is for us. Send it up if yes.</p>
<p>This basic implementation just forwards all message that are broadcast (destAddr = L2BROADCAST) or destined for this node (destAddr = nic module getId()) to the network layer</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="a00025.html#adbf061566606041db811b519f0400ed5" title="Sends a message to the upper layer.">sendUp</a> </dd></dl>

<p>Implements <a class="el" href="a00025.html#a5ca2278405070baa474dfbf059930247">BaseLayer</a>.</p>

<p>Reimplemented in <a class="el" href="a00069.html#a83911b5673de047bcfc3c9b0a719ff15">CSMAMacLayer</a>, <a class="el" href="a00223.html#acac82faa5c2357def7a7c0ac2363b88b">UWBIRMac</a>, <a class="el" href="a00128.html#ac8bfb04590aab2434bd8d17ee4e213d9">Mac80211</a>, <a class="el" href="a00067.html#afde05c6a829f672b556959acb26b0098">csma</a>, <a class="el" href="a00126.html#a0a7619fa37aadbcc587c735cc5cbcf99">LMacLayer</a>, <a class="el" href="a00035.html#ac16d3f8eda5c8d43c4a33a581aa4fbfb">BMacLayer</a>, and <a class="el" href="a00008.html#a585dd6a0b5c3c6a33e1f760ccd8ac29e">AlohaMacLayer</a>.</p>

<p>References <a class="el" href="a00026.html#a998b4c4c56074a354b50f8c4fc5d6d4c">decapsMsg()</a>, <a class="el" href="a00117.html#a3890f1c7314c5695e32252468e6bd5a5">LAddress::isL2Broadcast()</a>, <a class="el" href="a00026.html#a8a26df9da07801d8ccb530530ef57ee2">myMacAddr</a>, and <a class="el" href="a00025.html#adbf061566606041db811b519f0400ed5">BaseLayer::sendUp()</a>.</p>
<div class="fragment"><pre class="fragment">{
    macpkt_ptr_t     mac  = <span class="keyword">static_cast&lt;</span>macpkt_ptr_t<span class="keyword">&gt;</span>(msg);
    <a class="code" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210" title="Type definition for a L2 (MAC) address.">LAddress::L2Type</a> dest = mac-&gt;getDestAddr();
    <a class="code" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210" title="Type definition for a L2 (MAC) address.">LAddress::L2Type</a> src  = mac-&gt;getSrcAddr();

    <span class="comment">//only foward to upper layer if message is for me or broadcast</span>
    <span class="keywordflow">if</span>((dest == <a class="code" href="a00026.html#a8a26df9da07801d8ccb530530ef57ee2" title="MAC address.">myMacAddr</a>) || <a class="code" href="a00117.html#a3890f1c7314c5695e32252468e6bd5a5" title="Test if a L2 address (pSrcAddr) is a broadcast address.">LAddress::isL2Broadcast</a>(dest)) {
    coreEV &lt;&lt; <span class="stringliteral">&quot;message with mac addr &quot;</span> &lt;&lt; src
         &lt;&lt; <span class="stringliteral">&quot; for me (dest=&quot;</span> &lt;&lt; dest
         &lt;&lt; <span class="stringliteral">&quot;) -&gt; forward packet to upper layer\n&quot;</span>;
    <a class="code" href="a00025.html#adbf061566606041db811b519f0400ed5" title="Sends a message to the upper layer.">sendUp</a>(<a class="code" href="a00026.html#a998b4c4c56074a354b50f8c4fc5d6d4c" title="decapsulate the network message from the MacPkt">decapsMsg</a>(mac));
    }
    <span class="keywordflow">else</span>{
    coreEV &lt;&lt; <span class="stringliteral">&quot;message with mac addr &quot;</span> &lt;&lt; src
         &lt;&lt; <span class="stringliteral">&quot; not for me (dest=&quot;</span> &lt;&lt; dest
         &lt;&lt; <span class="stringliteral">&quot;) -&gt; delete (my MAC=&quot;</span>&lt;&lt;<a class="code" href="a00026.html#a8a26df9da07801d8ccb530530ef57ee2" title="MAC address.">myMacAddr</a>&lt;&lt;<span class="stringliteral">&quot;)\n&quot;</span>;
    <span class="keyword">delete</span> mac;
    }
}
</pre></div>
</div>
</div>
<a class="anchor" id="a6de2ca07018de313a7147a03e6d77bff"></a><!-- doxytag: member="BaseMacLayer::handleUpperMsg" ref="a6de2ca07018de313a7147a03e6d77bff" args="(cMessage *msg)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BaseMacLayer::handleUpperMsg </td>
          <td>(</td>
          <td class="paramtype">cMessage *&#160;</td>
          <td class="paramname"><em>mac</em></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Handle messages comming from the network layer. </p>
<p>Here is the place to implement a real medium access functionality.</p>
<p>If message arrives from upper layer, make a MAC packet from it (encapsMsg) and send it down (sendDown).</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="a00026.html#a0e1c8dad62e40f43a43c7b8a0cb71501" title="Encapsulate the NetwPkt into an MacPkt.">encapsMsg</a>, <a class="el" href="a00025.html#a1873d6e3fc6d92cf8482b39f1c5ac6c8" title="Sends a message to the lower layer.">sendDown</a></dd></dl>
<p>Redefine this function if you want to process messages from upper layers before they are send to lower layers.</p>
<p>To forward the message to lower layers after processing it please use <a class="el" href="a00025.html#a1873d6e3fc6d92cf8482b39f1c5ac6c8">sendDown</a>. It will take care of anything needed </p>

<p>Implements <a class="el" href="a00025.html#a8c0fcfb2e806357a65d5bdb1c338627b">BaseLayer</a>.</p>

<p>Reimplemented in <a class="el" href="a00069.html#a06c96c060afdff5c0f348b5ebef5c54d">CSMAMacLayer</a>, <a class="el" href="a00067.html#ad85c18d90e41eb2074593a44b64ab855">csma</a>, <a class="el" href="a00126.html#a7de5ee6f865e3ae8e7a9841291d36a37">LMacLayer</a>, <a class="el" href="a00128.html#af7e230f8713536482417699f2f6bee71">Mac80211</a>, and <a class="el" href="a00035.html#a43c9f5377b89dd4cd4e4e48fb3e96107">BMacLayer</a>.</p>

<p>References <a class="el" href="a00026.html#a0e1c8dad62e40f43a43c7b8a0cb71501">encapsMsg()</a>, and <a class="el" href="a00025.html#a1873d6e3fc6d92cf8482b39f1c5ac6c8">BaseLayer::sendDown()</a>.</p>
<div class="fragment"><pre class="fragment">{
    assert(dynamic_cast&lt;cPacket*&gt;(mac));
    <a class="code" href="a00025.html#a1873d6e3fc6d92cf8482b39f1c5ac6c8" title="Sends a message to the lower layer.">sendDown</a>(<a class="code" href="a00026.html#a0e1c8dad62e40f43a43c7b8a0cb71501" title="Encapsulate the NetwPkt into an MacPkt.">encapsMsg</a>(static_cast&lt;cPacket*&gt;(mac)));
}
</pre></div>
</div>
</div>
<a class="anchor" id="a61c82dc3b225eac37f7fa9936c28c2c3"></a><!-- doxytag: member="BaseMacLayer::initialize" ref="a61c82dc3b225eac37f7fa9936c28c2c3" args="(int)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BaseMacLayer::initialize </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>stage</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialization of the module and some variables. </p>
<p>First we have to initialize the module from which we derived ours, in this case <a class="el" href="a00025.html" title="A very simple layer template.">BaseLayer</a>. </p>

<p>Reimplemented from <a class="el" href="a00025.html#a70f5ea30a9980d57b8384faed29ec3eb">BaseLayer</a>.</p>

<p>Reimplemented in <a class="el" href="a00069.html#a660262c629f33b00401249d3fdac49be">CSMAMacLayer</a>, <a class="el" href="a00067.html#a24e7a48bd1d9036139c75b558ade4161">csma</a>, <a class="el" href="a00126.html#a2100ca7de5c5eedb3e7f0e11ca9fca14">LMacLayer</a>, <a class="el" href="a00128.html#ab81dae24d79c2ef010301e2c219966c1">Mac80211</a>, <a class="el" href="a00035.html#aacfdc6bca51f7097b58556fdf1744689">BMacLayer</a>, <a class="el" href="a00223.html#a0fcaae9c3cefb73372b7290ff4d9092d">UWBIRMac</a>, <a class="el" href="a00008.html#abab6939a0c82122391528d386df97c2c">AlohaMacLayer</a>, <a class="el" href="a00068.html#abbb7175c6f28345ca29c3ca6f98732fc">CSMA802154</a>, and <a class="el" href="a00129.html#aa7351afc794f983e34dbc86d63cb3dea">Mac80211MultiChannel</a>.</p>

<p>References <a class="el" href="a00026.html#ab3111737703e0d4b5198478fb1f75e60">coreDebug</a>, <a class="el" href="a00027.html#aabf0226159b22b46e70031fd3bb3b1b2">BaseModule::findHost()</a>, <a class="el" href="a00026.html#ae51d8e3e0977cfc1d4f10f8135378fc4">getNic()</a>, <a class="el" href="a00134.html#a700bd4a7b79a58b2c5713f976ba7e4b7">MacToPhyInterface::getPhyHeaderLength()</a>, <a class="el" href="a00026.html#a26ddb186455b73c8dc8b5698296804d2">headerLength</a>, <a class="el" href="a00117.html#a6db1e8dbd0d23dec49ce7b59f5c15976">LAddress::L2NULL</a>, <a class="el" href="a00004.html#a7d81614e8dea6e3a7316184e6b9e959c">AddressingInterface::myMacAddr()</a>, <a class="el" href="a00026.html#a8a26df9da07801d8ccb530530ef57ee2">myMacAddr</a>, <a class="el" href="a00026.html#aa7b1e6bdb734765a9f4eff7d486dfbea">phy</a>, <a class="el" href="a00026.html#ab54fe535cdac4d9ee526153163991b4d">phyHeaderLength</a>, and <a class="el" href="a00026.html#adc87295362ca7859cb6fe2a5bbe3c90d">registerInterface()</a>.</p>

<p>Referenced by <a class="el" href="a00223.html#a0fcaae9c3cefb73372b7290ff4d9092d">UWBIRMac::initialize()</a>.</p>
<div class="fragment"><pre class="fragment">{
    <a class="code" href="a00026.html#a61c82dc3b225eac37f7fa9936c28c2c3" title="Initialization of the module and some variables.">BaseLayer::initialize</a>(stage);

    <span class="keywordflow">if</span> (stage == 0)
    {
        <span class="comment">// get handle to phy layer</span>
        <span class="keywordflow">if</span> ((<a class="code" href="a00026.html#aa7b1e6bdb734765a9f4eff7d486dfbea" title="Handler to the physical layer.">phy</a> = <a class="code" href="a00093.html" title="Provides method templates to find omnet modules.">FindModule&lt;MacToPhyInterface*&gt;::findSubModule</a>(<a class="code" href="a00026.html#ae51d8e3e0977cfc1d4f10f8135378fc4" title="Pointer to nic Module.">getNic</a>())) == NULL) {
            error(<span class="stringliteral">&quot;Could not find a PHY module.&quot;</span>);
        }
        <a class="code" href="a00026.html#a26ddb186455b73c8dc8b5698296804d2" title="Pointer to the arp module.">headerLength</a> = par(<span class="stringliteral">&quot;headerLength&quot;</span>);
        <a class="code" href="a00026.html#ab54fe535cdac4d9ee526153163991b4d" title="The length of the phy header (in bits).">phyHeaderLength</a> = <a class="code" href="a00026.html#aa7b1e6bdb734765a9f4eff7d486dfbea" title="Handler to the physical layer.">phy</a>-&gt;<a class="code" href="a00134.html#a700bd4a7b79a58b2c5713f976ba7e4b7" title="Returns the length of the phy header in bits.">getPhyHeaderLength</a>();

        hasPar(<span class="stringliteral">&quot;coreDebug&quot;</span>) ? <a class="code" href="a00026.html#ab3111737703e0d4b5198478fb1f75e60" title="debug this core module?">coreDebug</a> = par(<span class="stringliteral">&quot;coreDebug&quot;</span>).boolValue() : <a class="code" href="a00026.html#ab3111737703e0d4b5198478fb1f75e60" title="debug this core module?">coreDebug</a> = <span class="keyword">false</span>;
    }
    <span class="keywordflow">if</span> (<a class="code" href="a00026.html#a8a26df9da07801d8ccb530530ef57ee2" title="MAC address.">myMacAddr</a> == <a class="code" href="a00117.html#a6db1e8dbd0d23dec49ce7b59f5c15976" title="NULL address for L2 addresses.">LAddress::L2NULL</a>) {
        <span class="comment">// see if there is an addressing module available</span>
        <span class="comment">// otherwise use NIC modules id as MAC address</span>
        <a class="code" href="a00004.html" title="Interface for modules which assign L2 and L3 addresses for modules.">AddressingInterface</a>* addrScheme = <a class="code" href="a00093.html" title="Provides method templates to find omnet modules.">FindModule&lt;AddressingInterface*&gt;::findSubModule</a>(<a class="code" href="a00027.html#aabf0226159b22b46e70031fd3bb3b1b2" title="Function to get a pointer to the host module.">findHost</a>());
        <span class="keywordflow">if</span>(addrScheme) {
            <a class="code" href="a00026.html#a8a26df9da07801d8ccb530530ef57ee2" title="MAC address.">myMacAddr</a> = addrScheme-&gt;<a class="code" href="a00004.html#a7d81614e8dea6e3a7316184e6b9e959c" title="Returns the L2 address for the passed mac.">myMacAddr</a>(<span class="keyword">this</span>);
        } <span class="keywordflow">else</span> {
            <span class="keyword">const</span> std::string addressString = par(<span class="stringliteral">&quot;address&quot;</span>).stringValue();
            <span class="keywordflow">if</span> (addressString.empty() || addressString == <span class="stringliteral">&quot;auto&quot;</span>)
                <a class="code" href="a00026.html#a8a26df9da07801d8ccb530530ef57ee2" title="MAC address.">myMacAddr</a> = <a class="code" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210" title="Type definition for a L2 (MAC) address.">LAddress::L2Type</a>(<a class="code" href="a00026.html#ae51d8e3e0977cfc1d4f10f8135378fc4" title="Pointer to nic Module.">getNic</a>()-&gt;getId());
            <span class="keywordflow">else</span>
                <a class="code" href="a00026.html#a8a26df9da07801d8ccb530530ef57ee2" title="MAC address.">myMacAddr</a> = <a class="code" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210" title="Type definition for a L2 (MAC) address.">LAddress::L2Type</a>(addressString.c_str());
            <span class="comment">// use streaming operator for string conversion, this makes it more</span>
            <span class="comment">// independent from the myMacAddr type</span>
            std::ostringstream oSS; oSS &lt;&lt; <a class="code" href="a00026.html#a8a26df9da07801d8ccb530530ef57ee2" title="MAC address.">myMacAddr</a>;
            par(<span class="stringliteral">&quot;address&quot;</span>).setStringValue(oSS.str());
        }
        <a class="code" href="a00026.html#adc87295362ca7859cb6fe2a5bbe3c90d" title="Registers this bridge&#39;s NIC with INET&#39;s InterfaceTable.">registerInterface</a>();
    }
}
</pre></div>
</div>
</div>
<a class="anchor" id="ab57af129814d784f2a96978f036c575a"></a><!-- doxytag: member="BaseMacLayer::setDownControlInfo" ref="ab57af129814d784f2a96978f036c575a" args="(cMessage *const pMsg, Signal *const pSignal)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cObject * BaseMacLayer::setDownControlInfo </td>
          <td>(</td>
          <td class="paramtype">cMessage *const&#160;</td>
          <td class="paramname"><em>pMsg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00192.html">Signal</a> *const&#160;</td>
          <td class="paramname"><em>pSignal</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Attaches a "control info" (MacToPhy) structure (object) to the message pMsg. </p>
<p>This is most useful when passing packets between protocol layers of a protocol stack, the control info will contain the signal.</p>
<p>The "control info" object will be deleted when the message is deleted. Only one "control info" structure can be attached (the second setL3ToL2ControlInfo() call throws an error).</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pMsg</td><td>The message where the "control info" shall be attached. </td></tr>
    <tr><td class="paramname">pSignal</td><td>The signal which should be send. </td></tr>
  </table>
  </dd>
</dl>

<p>References <a class="el" href="a00133.html#a5b1c091d57ea342922940df4d66491df">MacToPhyControlInfo::setControlInfo()</a>.</p>

<p>Referenced by <a class="el" href="a00126.html#a14db63191f60dc3f3b906ce02eec6628">LMacLayer::attachSignal()</a>, <a class="el" href="a00035.html#a5f0384e6e1a28a7d303ec5d6d2cc9dd4">BMacLayer::attachSignal()</a>, <a class="el" href="a00069.html#a89de5fd0b7f0d1420c1d4e9118c00ef3">CSMAMacLayer::encapsMsg()</a>, <a class="el" href="a00128.html#a1c404a5176db493c2fefb71537783607">Mac80211::sendACKframe()</a>, <a class="el" href="a00128.html#a26b30d048980b56d79c04e859bfce009">Mac80211::sendBROADCASTframe()</a>, <a class="el" href="a00128.html#a1fd59a589e53facb68c13be84521a49e">Mac80211::sendCTSframe()</a>, <a class="el" href="a00128.html#a7a4ff22b4b999827a898794923115880">Mac80211::sendDATAframe()</a>, and <a class="el" href="a00128.html#a3104750758ab171b20ffcfeae0079a78">Mac80211::sendRTSframe()</a>.</p>
<div class="fragment"><pre class="fragment">{
    <span class="keywordflow">return</span> <a class="code" href="a00133.html#a5b1c091d57ea342922940df4d66491df" title="Attaches a &quot;control info&quot; structure (object) to the message pMsg.">MacToPhyControlInfo::setControlInfo</a>(pMsg, pSignal);
}
</pre></div>
</div>
</div>
<a class="anchor" id="a3f1d2f1614a5d25f8b5f64b74e1c40a7"></a><!-- doxytag: member="BaseMacLayer::setUpControlInfo" ref="a3f1d2f1614a5d25f8b5f64b74e1c40a7" args="(cMessage *const pMsg, const LAddress::L2Type &amp;pSrcAddr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cObject * BaseMacLayer::setUpControlInfo </td>
          <td>(</td>
          <td class="paramtype">cMessage *const&#160;</td>
          <td class="paramname"><em>pMsg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="a00117.html#aea56b60dcb5ae8c2bde465271daf7210">LAddress::L2Type</a> &amp;&#160;</td>
          <td class="paramname"><em>pSrcAddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Attaches a "control info" (MacToNetw) structure (object) to the message pMsg. </p>
<p>This is most useful when passing packets between protocol layers of a protocol stack, the control info will contain the destination MAC address.</p>
<p>The "control info" object will be deleted when the message is deleted. Only one "control info" structure can be attached (the second setL3ToL2ControlInfo() call throws an error).</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pMsg</td><td>The message where the "control info" shall be attached. </td></tr>
    <tr><td class="paramname">pSrcAddr</td><td>The MAC address of the message receiver. </td></tr>
  </table>
  </dd>
</dl>

<p>References <a class="el" href="a00132.html#a08ffc5756ab41f2c5ba4e7fa1f64b924">MacToNetwControlInfo::setControlInfo()</a>.</p>

<p>Referenced by <a class="el" href="a00026.html#a998b4c4c56074a354b50f8c4fc5d6d4c">decapsMsg()</a>, <a class="el" href="a00128.html#a9c6a33b29ff6e1500947fd6ca221b13e">Mac80211::decapsMsg()</a>, and <a class="el" href="a00067.html#aedcaefc83f850c1ca35836cb223b412e">csma::decapsMsg()</a>.</p>
<div class="fragment"><pre class="fragment">{
    <span class="keywordflow">return</span> <a class="code" href="a00132.html#a08ffc5756ab41f2c5ba4e7fa1f64b924" title="Attaches a &quot;control info&quot; structure (object) to the message pMsg.">MacToNetwControlInfo::setControlInfo</a>(pMsg, pSrcAddr);
}
</pre></div>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a26ddb186455b73c8dc8b5698296804d2"></a><!-- doxytag: member="BaseMacLayer::headerLength" ref="a26ddb186455b73c8dc8b5698296804d2" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long <a class="el" href="a00026.html#a26ddb186455b73c8dc8b5698296804d2">BaseMacLayer::headerLength</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Pointer to the arp module. </p>
<p>Length of the MacPkt header </p>

<p>Referenced by <a class="el" href="a00035.html#acff92f0d4ba44ee5035c0d3729729257">BMacLayer::addToQueue()</a>, <a class="el" href="a00126.html#a85b92d5d2292228cb408f4e72fca7caf">LMacLayer::encapsMsg()</a>, <a class="el" href="a00026.html#a0e1c8dad62e40f43a43c7b8a0cb71501">encapsMsg()</a>, <a class="el" href="a00126.html#a2397193676d296cc6757b31eef203bb3">LMacLayer::handleSelfMsg()</a>, <a class="el" href="a00067.html#ad85c18d90e41eb2074593a44b64ab855">csma::handleUpperMsg()</a>, <a class="el" href="a00126.html#a2100ca7de5c5eedb3e7f0e11ca9fca14">LMacLayer::initialize()</a>, <a class="el" href="a00026.html#a61c82dc3b225eac37f7fa9936c28c2c3">initialize()</a>, <a class="el" href="a00035.html#af2a4df90f60f2c5b93813b5424f7ee0f">BMacLayer::sendMacAck()</a>, and <a class="el" href="a00035.html#afeb78e201913f491b8abb8416dd6eefc">BMacLayer::sendPreamble()</a>.</p>

</div>
</div>
<a class="anchor" id="ab54fe535cdac4d9ee526153163991b4d"></a><!-- doxytag: member="BaseMacLayer::phyHeaderLength" ref="ab54fe535cdac4d9ee526153163991b4d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long <a class="el" href="a00026.html#ab54fe535cdac4d9ee526153163991b4d">BaseMacLayer::phyHeaderLength</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The length of the phy header (in bits). </p>
<p>Since the MAC layer has to create the signal for a transmission it has to know the total length of the packet and therefore needs the length of the phy header. </p>

<p>Referenced by <a class="el" href="a00026.html#a61c82dc3b225eac37f7fa9936c28c2c3">initialize()</a>, and <a class="el" href="a00128.html#a6732e4a776e78432bf5dd9dd26de2f7d">Mac80211::packetDuration()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/base/modules/<a class="el" href="a00270_source.html">BaseMacLayer.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/base/modules/BaseMacLayer.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00026.html">BaseMacLayer</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:31 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
